package com.liuceng.zen.service;

import com.liuceng.zen.mapper.CustomerInfoMailNotificationMapper;
import com.liuceng.zen.pojo.domain.CustomerInfoMailNotification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by liyuhang on 2016-1-9.
 */
@Service
public class CustomerInfoMailNotificationService extends BaseService<CustomerInfoMailNotification> {

  @Autowired
  CustomerInfoMailNotificationMapper notificationMapper;

  public List<CustomerInfoMailNotification> findEmailList(Map<String, Object> params) {
    return notificationMapper.search(params);
  }

  public Integer countByEmailAndEmailType(String email, Integer emailType, Integer memberId) {
    Map<String, Object> params = new HashMap<>();
    params.put("email", email);
    params.put("emailType", emailType);
    params.put("memberId", memberId);

    return notificationMapper.count(params);
  }

}
